<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .isred {
            color: red;
        }

        .isblue {
            color: blue;
        }

        .size {
            font-size: 40px;
        }

        .bg {
            background-color: #faaadf;
            border-radius: 5px;
        }
    </style>
</head>

<body>
    <div id="app">
        <h1>{{message}}</h1>
        <button class="bg" :class="['size',{isred:isclick}]" @click="clickit">点击一下</button><br>
        <button :style="but2">登录</button>
        <!-- 绑定一个对象 -->
        <h2 v-bind="infor">绑定一个对象</h2>
    </div>
    <script src="https://unpkg.com/vue@next"></script>
    <script>
        //用vue创建app
        const app = Vue.createApp({

            data: function () {
                return {
                    message: "Hello world",
                    isclick: false,
                    but2: {
                        color: "skyblue",
                        fontSize: "30px"
                    },
                    infor: {
                        name: "ran",
                        age: 19
                    }
                }
            },
            methods: {
                clickit: function () {
                    this.isclick = !this.isclick
                }
            }
        })
        //挂载app
        app.mount("#app")
    </script>

</body>

</html>